package com.neuedu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.neuedu.entity.UmsDept;
import com.neuedu.mapper.UmsDeptMapper;
import com.neuedu.service.UmsDeptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 科室表 服务实现类
 * </p>
 *
 * @author 王禹
 * @since 2025-08-08
 */
@Service
public class UmsDeptServiceImpl extends ServiceImpl<UmsDeptMapper, UmsDept> implements UmsDeptService {

    @Override
    @Cacheable(value = "pms:regist:dept", key = "'list'")
    public List<UmsDept> listForRegist() {
        QueryWrapper<UmsDept> wrapper = new QueryWrapper<>();
        wrapper.eq("register", 1)
                .eq("active", 1);
        return this.list(wrapper);
    }
}
